<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
        xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
        xmlns:email="http://saxonextensions.org/email">

  <!-- Configure JBoss EML Emitter -->
  <xsl:output name="email"
    method="email:org.saxonextensions.eml.emitter.JBossEMLEmitter"
    email:mail-session-jndi-name="java:/Mail"
    email:dispatcher-jndi-name="java:/EMLDispatcher"
    email:debug="true"
    email:debug-output-folder="-eml-debug-"
    indent="yes"
    encoding="UTF-8"/>

  <!--
    Root template, send a single test message
  -->
  <xsl:template match="/">
    <xsl:result-document format="email" href="dev://null">
      <email:Subject>This is the test email.</email:Subject>
      <email:From name="Email Emitter Test Application">user@host.dm</email:From>
      <email:To name="Anybody">user@host.dm</email:To>
      <email:Part Content-Type="text/html; charset=UTF-8">
        <html xmlns="http://www.w3.org/1999/xhtml">
        <head>
          <title>This is the test message.</title>
          <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        </head>
        <body>
          <h1>Congratulations !</h1>
          <p>If you can read this message, you have seccessfully set-up Email Emitter test application.</p>
        </body>
        </html>
      </email:Part>
    </xsl:result-document>
  </xsl:template>

</xsl:stylesheet>
